<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="div" style="width: 500px;height: 500px;background-color: blueviolet"></div>
<script type="text/javascript">
    var div = document.getElementById("div");

    function changeSize() {
        div.style.width = '300px'
        div.style.height = '300px'
    }

    function changeColor() {
        div.style.backgroundColor = 'red'
    }

    // div.onclick = changeColor
    // div.onclick = changeSize
    div.addEventListener("click",changeSize)
    div.addEventListener("click",changeColor)
</script>
</body>
</html>